package com.example.feilin.controller;

import java.util.HashMap;
import java.util.Map;

import com.example.feilin.entity.Queue;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Page;

public class IndexController extends Controller {
	
	public void index() {
		
		render("index.html");
	}
	
	public void json() {
		int pageNumber = getParaToInt("page");
		int pageSize = getParaToInt("pagesize");
		String sortName = getPara("sortname");
		String sortOrder = getPara("sortorder");
		
		Page<Queue> page = Queue.me.paginate(getParaToInt(0, pageNumber), pageSize);
		Map map = new HashMap();
		map.put("Rows", page.getList());
		map.put("Total", page.getTotalPage()); 
		renderJson(map);
	}
	
	public void form() {
		render("form.html");
	}

}
